SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO

CREATE PROCEDURE [dbo].[paObtenerNombreVistaReferencial] 

@Vista  varchar(50),
@Campo  varchar(50),
@VistaReferencia varchar(50) output

 AS
SET NOCOUNT ON
SELECT TOP 1 @VistaReferencia = TablaVistaReferencia FROM Tb_VistasCombos  WHERE Vista=@Vista and Campo=@Campo
GO
GRANT EXECUTE ON  [dbo].[paObtenerNombreVistaReferencial] TO [public]
GO
